<template>
  <el-dialog v-model="dialogVisible" title="个人信息" width="500px" draggable>
    <el-form :inline="true" :model="formData" class="demo-form-inline" label-width="5rem">
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="电话">
            <el-input v-model="formData.phone" clearable disabled placeholder="" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确认</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
import { computed, reactive, ref } from "vue";
import { useUserStore } from "@/stores/modules/user";

const dialogVisible = ref(false);
const openDialog = () => {
  dialogVisible.value = true;
};
const userStore = useUserStore();
const formData = reactive({
  phone: computed(() => userStore.userInfo.phone)
});
defineExpose({ openDialog });
</script>
